﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AccordionMenu.ascx.cs" Inherits="Dune.Web.Controls.AccordionMenu" %>
<div id="accordion">
<asp:Repeater runat="server" ID="rprMenu">
    <ItemTemplate>
        <div class='ui-accordion-group' >
				<h3 class='ui-accordion-header<%# (bool)DataBinder.Eval(Container.DataItem, "Current") ?  " current" : ""%>'><a href=""><%# DataBinder.Eval(Container.DataItem, "Name")%></a></h3>
				<div class="ui-accordion-content">
				<span onclick="GetHTML('<%# DataBinder.Eval(Container.DataItem, "UrlPath")%>')"><%# DataBinder.Eval(Container.DataItem, "Name")%></span>
                    <asp:Repeater DataSource='<%# DataBinder.Eval(Container.DataItem, "Childrens")%>' runat="server" ID="rprSubMenu">
                        <HeaderTemplate><ul></HeaderTemplate>
                        <ItemTemplate>
                            <li>
                                <a href='Themes.aspx?id=<%# DataBinder.Eval(Container, "DataItem.UrlPath")%>'><%# DataBinder.Eval(Container, "DataItem.Name")%></a>
                            </li>
                        </ItemTemplate>
                        <FooterTemplate></ul></FooterTemplate>
                    </asp:Repeater>
				</div>
        </div>
    </ItemTemplate>    
</asp:Repeater>
<script type="text/javascript">

function GetHTML(id) {
    $('#content').html("&nbsp;");
	url = 'AjaxHtmlContent.aspx?Content=Theme&id='+id;
	$('#content').load(url);
}

$(document).ready(function() {
    GetHTML('<%=CurrentId %>');
});

</script>

</div>
